package com.bangdream.michelia.view.adapter;


import android.text.Html;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;

import com.bangdream.michelia.R;
import com.bangdream.michelia.entity.LearningBean;
import com.bangdream.michelia.entity.TeacherBean;
import com.bangdream.michelia.utils.ImageLoadUtils;
import com.bangdream.michelia.utils.SPUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * Created by zhouyi on 2018/3/25.
 */

public class LearningRecordAdapter extends BaseQuickAdapter<LearningBean,BaseViewHolder> {
    public LearningRecordAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, LearningBean item) {
        ImageView iv=helper.getView(R.id.ivIcon);
        ImageLoadUtils.ImageLoad(mContext,item.getFaceUrl(),iv,-1);
        String s = (String) SPUtils.get(mContext, "domainName", "白玉兰在线");
        helper.setText(R.id.tv_org_name,s);
        helper.setText(R.id.tvTitle,item.getName());
        helper.setText(R.id.tvDes,item.getTitle());


        helper.setText(R.id.tv_learn_per,"已学完"+item.getPer()+"%");
        helper.setProgress(R.id.mProgressBar,(int)item.getPer());
    }
}
